package com.neuedu.i18n;

import java.util.Locale;
import java.util.ResourceBundle;

public class ResoueceTest {


    public static void main(String[] args) {


            //获取默认 中文
            ResourceBundle resourceBundle = ResourceBundle.getBundle("internationalization");

            String key1 = resourceBundle.getString("key1");
            String key2 = resourceBundle.getString("key2");
            String key3 = resourceBundle.getString("key3");

            System.out.println("key1 = " + key1);
            System.out.println("key2 = " + key2);
            System.out.println("key3 = " + key3);



            //获取英文环境
            ResourceBundle resourceBundle1 = ResourceBundle.getBundle("internationalization", Locale.ENGLISH);

            String key11 = resourceBundle1.getString("key1");
            String key12 = resourceBundle1.getString("key2");
            String key13 = resourceBundle1.getString("key3");

            System.out.println("key1 = " + key11);
            System.out.println("key2 = " + key12);
            System.out.println("key3 = " + key13);


    }
}
